let config = require('../config')
let mongoose = require('mongoose')

mongoose.Promise =Promise;

mongoose.connect(config.mongodb);

let db = mongoose.connection;

db.on('error', (err)=>{
    console.log("connect error:", err);
});

db.once('open', () => {
    console.log('MongoDB is ready')
});


module.exports = {
  teacher : require('./teacher'),
  student : require('./student'),
  course : require('./course'),
  sign : require('./sign'),
}